package cn.canway.xunyou_test.controller;

import cn.canway.xunyou_test.bean.User;
import cn.canway.xunyou_test.service.UserService;
import cn.canway.xunyou_test.util.JSONChange;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    public UserService userService;
    @RequestMapping("/login")
    public String login() throws Exception {
        User user = userService.login("test","123456");
        System.out.println(user.getName());
        return JSONChange.objToJson(user);
    }
}
